package gclib.inventory;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;

/**
 *
 * @author Jason
 */
@Entity
@DiscriminatorValue("Armor")
public class Armor extends Item {

    @Column(name="ARMOR_TYPE")
    @Enumerated(EnumType.STRING)
    private TYPE armorType = TYPE.CLOTH;

    public Armor() {
        super();
    }

    public Armor(String name, String description, Double weight) {
        super(name, description, weight);
    }

    public TYPE getArmorType() {
        return armorType;
    }

    public void setArmorType(TYPE armorType) {
        this.armorType = armorType;
    }

    @Override
    public String toString() {
        StringBuilder result = new StringBuilder("Armor [");
        result.append("super:").append(super.toString()).append(", ");
        result.append("armorType:").append(armorType.name());
        return result.append(']').toString();
    }

    public static enum TYPE {

        CLOTH, LEATHER, HIDE, CHAINMAIL, SCALE, PLATE, LIGHT_SHIELD, HEAVY_SHIELD
    };
}
